<template>

    <router-view v-slot="{ Component }">
      <keep-alive>
        <component :is="Component" />
      </keep-alive>
    </router-view>
    <!-- <router-view></router-view> -->
    
    <van-tabbar v-model="store.active" @change="onChange"  active-color="#FF9999"
                :placeholder="true" :border="true" >
        <van-tabbar-item  name="diary"  icon="like">日记</van-tabbar-item>
        <van-tabbar-item  name="note"   icon="todo-list">待办</van-tabbar-item>
        <van-tabbar-item  name="share"  icon="friends">社区</van-tabbar-item>
        <van-tabbar-item  name="info"   icon="wap-home">家</van-tabbar-item>
    </van-tabbar>
</template>
  




<script>
import axios from 'axios'
import {store} from '../utils/store.js'

  export default {
    created(){
    },
    data() {
      return {
        store,
        // active的值需要后端返回,并且根据值进行一次跳转
        // isLoading : false
      }
    },
    name: 'HomeView',
    methods:{
      onChange(){
        // console.log(this.active)
        this.$router.push("/home/"+store.active)
      },
      // onRefresh(){
      //   console.log("a")
      //   setTimeout(()=>{
      //     this.isLoading = false
      //   },500)
      // }
    }
  }
</script>







